package com.cqeec.netdisc0215.service;

import java.io.InputStream;

import org.openstack4j.model.common.Payloads;
import org.springframework.stereotype.Service;

import com.cqeec.netdisc0215.util.OpenStackClientUtil;

@Service
public class FileServiceImpl implements FileService{

	@Override
	public void uploadFile(String path, String fileName, InputStream inputStream) {
		OpenStackClientUtil.getOSClient().objectStorage().objects().put(path, fileName,
				Payloads.create(inputStream));
	}

	@Override
	public void deleteFile(String path, String name) {
		OpenStackClientUtil.getOSClient().objectStorage().objects().delete(path, name);
	}

}